package com.lbg.drug.controller;


import com.lbg.drug.commont.untils.R;
import com.lbg.drug.entity.Menu;
import com.lbg.drug.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * <p>
 *  前端控制器1
 * </p>
 *
 * @author lbg
 * @since 2022-04-27
 */
@RestController
@RequestMapping("/menu")
public class MenuController {


    @Autowired
    private MenuService menuService;


    @GetMapping("/nav")
    public R nav(HttpSession session){
        List<Menu> menu = menuService.getMenu(session);
        return R.ok().put("menu",menu);

    }

}

